---
id: 660f0c34aad72dc712b97624
title: Step 22
challengeType: 1
dashedName: step-22
---

# --description--

Another method essential for this project is the `.pop()` method. It removes the last element from an array and <dfn>returns</dfn> that element.

When a method returns a value, you can think of it as giving the value back to you, making it available for use in other parts of your code.

Create a new variable called `popped` and assign it the result of `rows.pop()`. Then, log `popped` to the console.

# --hints--

You should declare a variable called `popped`.

```js
assert.match(code, /popped/);
```

You should use `let` to declare your variable called `popped`.

```js
assert.match(code, /let\s+popped/);
```

You should call the `.pop()` method.

```js
assert.match(code, /\.pop\(\s*\)/);
```

You should call the `.pop()` method on your `rows` array.

```js
assert.match(code, /rows\.pop\(\s*\)/);
```

You should log your `popped` variable.

```js
assert.match(code, /console\.log\(\s*popped\s*\)/);
```

# --seed--

## --seed-contents--

```js
let character = 'Hello';
let count = 8;
--fcc-editable-region--
let rows = ["Naomi", "Quincy", "CamperChan"];
rows.push("freeCodeCamp");

console.log(rows);
--fcc-editable-region--
```
